

#ifndef _TYPEDEF_H_
#define _TYPEDEF_H_

#include <stddef.h>
//#include <stdint.h>
//#include "stdbool.h"


#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>


#ifndef TRUE
#define TRUE (1)
#endif

#ifndef FALSE
#define FALSE (0)
#endif

#ifndef true
#define true (1)
#endif

#ifndef false
#define false (0)
#endif

#ifndef HI
#define HI (1)
#endif

#ifndef LO
#define LO (0)
#endif

#ifndef ON
#define ON (1)
#endif

#ifndef OFF
#define OFF (0)
#endif

#define MAX_UINT8  ((uint8)(0xFFU))
#define MIN_UINT8  ((uint8)(0x00U))
#define MAX_INT8   ((int8)(0x7F))
#define MIN_INT8  ((int8)(0x80))

#define MAX_UINT16 ((uint16)(0xFFFFU))
#define MIN_UINT16 ((uint16)(0x0000U))
#define MAX_INT16  ((int16)(0x7FFF))
#define MIN_INT16  ((int16)(0x8000))

#define MAX_UINT32 ((uint32)(0xFFFFFFFFUL))
#define MIN_UINT32 ((uint32)(0x00000000UL))
#define MAX_INT32  ((int132)(0x7FFFFFFFL))
#define MIN_INT32  ((int32)(0x80000000L))

typedef signed char int8;
typedef signed char sint8;
typedef unsigned char uint8;
typedef signed short  int16;
typedef signed short  sint16;
typedef unsigned short  uint16;
typedef unsigned long uint32;
typedef long int32;
typedef long sint32;
typedef uint8 boolean;

#ifndef NULL
#define NULL (0)
#endif

#define VALUE_isotp_go_busy		(0xFFU)
#define VALUE_isotp_keep_busy	(0xFEU)
#define VALUE_isotp_leave_busy	(0xFDU)
#define VALUE_buffer_locked		(0xFCU)

#define VALUE_ind_desc_busy		(0xABU)
#define VALUE_zero_no_error		(0x00U)

#define array_length(arr) (sizeof(arr) / sizeof((arr)[0U]))

#define CONTACT_TWO_TOKENS(a,b)            a ## b
#define CONTACT_THREE_TOKENS(a,b,c)        a ## b ## c
#define CONTACT_FOUR_TOKENS(a,b,c,d)       a ## b ## c ## d
#define CONTACT_FIVE_TOKENS(a,b,c,d,e)     a ## b ## c ## d ## e
#define CONTACT_SIX_TOKENS(a,b,c,d,e,f)    a ## b ## c ## d ## e ## f
#define POUND_CHAR  #


#endif /* _TYPEDEF_H_ */
